<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">
	
<h:body>
	<ui:composition template="/templates/templateCRUD.xhtml">
		<ui:param name="tituloCadastro" value="Cadastro de Convênio" />
		<ui:param name="tituloPesquisa" value="Pesquisa de Convênio" />
		<ui:param name="tituloGrid" value="Lista de Convenios" />
		<ui:param name="mbean" value="${convenioMB}" />
		<ui:define name="cadastro">
			<p:tabView>
				<p:tab title="Dados convênio">
				    <p:focus for="nomeCadastro"/>
					<h:panelGrid columns="3">
						<h:outputText value="*Nome:" />
						<p:inputText value="#{mbean.bean.nome}" disabled="#{mbean.readOnly}" size="54" maxlength="50" required="true" label="Nome" id="nomeCadastro"/>
						<p:message for="nomeCadastro" showDetail="true" showSummary="true"/>
						
						<h:outputText value="Descrição:" />
						<p:inputTextarea value="#{mbean.bean.descricao}" disabled="#{mbean.readOnly}" cols="54" rows="4" required="false" label="Descricao" id="descricaoCadastro"/>
						<p:message for="descricaoCadastro" showDetail="true" showSummary="true"/>
						
					</h:panelGrid>
				</p:tab>
			</p:tabView>
		</ui:define>

		<ui:define name="pesquisa">
            <p:focus for="nomePesquisa"/>
			<h:panelGrid columns="2">
				<h:outputText value="Nome:" />
				<p:inputText value="#{mbean.beanSearch.nome}" size="54" maxlength="50" id="nomePesquisa"/>
				<!-- <h:outputText value="Descricão:" />
				<p:inputTextarea value="#{mbean.beanSearch.descricao}" cols="54" rows="4" /> -->
			</h:panelGrid>
		</ui:define>
		
		<ui:define name="gridPesquisa">
			<p:column>
				<f:facet name="header">
					<h:outputText value="Nome"/>
				</f:facet>
				<h:outputText value="#{registro.nome}"/>
			</p:column>

			<p:column>
				<f:facet name="header">
					<h:outputText value="Descricão"/>
				</f:facet>
				<h:outputText value="#{registro.descricao}"/>
			</p:column>
			
		</ui:define>
	</ui:composition>
</h:body>
</html>
